<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$is_language?'經紀商設置':'Broker setting '}</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/weui.min.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/jquery-weui.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/demos.css">
    <script src="__MODULE_LIBS__/js/jquery-2.1.4.js"></script>
    <script src="__MODULE_LIBS__/js/fastclick.js"></script>
    <script src="__MODULE_LIBS__/js/jquery-weui.js"></script>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        html {
            width: 100%;
            height: 100%;
            font-size: 20px;
            font-family: "Microsoft YaHei", "宋体", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
            background: #F3F3F3;
        }

        body {
            margin: 0 auto;
            max-width: 750px;
            height: 100%;
            background: #F7F7F7;
        }

        /*顶部导航栏处的样式*/
        .navbar {
            position: relative;
            width: 100%;
            height: 2rem;
            font-size: 16px;
            color: #fff;
            line-height: 2rem;
            background: #373553;
        }

        .navbar-item {
            position: absolute;
            left: 0;
            top: 0;
            display: block;
            width: 3.2rem;
            height: 2rem;
            font-size: 14px;
            color: #fff;
            text-align: center;
        }

        .navbar-item > img {
            width: 0.8rem;
            height: 0.7rem;
            vertical-align: middle;
        }

        .navbar-center {
            text-align: center;
        }

        /*主体部分的样式*/
        .content {
            width: 100%;
        }

        .concenter {
            position: relative;
            padding: 0.5rem;
            margin-top: 1rem;
            background: #fff;
            overflow: hidden;
        }

        .title {
            font-size: 0.7rem;
        }

        #rmb {
            margin-top: 0.5rem;
            padding-left: 1.2rem;
            width: 100%;
            height: 1.8rem;
            font-size: 1.4rem;
            color: #555;
            border: 0;
            outline: none;
            border-bottom: 1px #ccc solid;
        }

        .record {
            position: absolute;
            right: 0.5rem;
            top: 0.7rem;
            display: inline-block;
            width: 3rem;
            height: 1rem;
            text-align: right;
            font-size: 0.6rem;
            color: #468EE6;;
        }

        .fh {
            position: absolute;
            top: 1.9rem;
            left: 0.5rem;
            font-size: 1.5rem;
        }

        .remark {
            margin-top: 0.2rem;
            font-size: 0.7rem;
            color: #777777;
            line-height: 1.4;
        }

        .weui-cell {
            padding: 0.5rem;
            font-size: 0.8rem;
        }

        .weui-cell__hd {
            width: 4.3rem;
        }

        .conversion {
            margin-top: 0.2rem;
            font-size: 0.7rem;
            color: #f44444;
        }
        .weui-cell__hd {
            margin-right: 1rem;
        }
        .weui-vcode-btn1 {
            display: inline-block;
            padding: 0 .6em 0 .7em;
            border-left: 1px solid #e5e5e5;
            line-height: 44px;
            font-size: 17px;
            color: #3cc51f;
        }
    </style>
</head>
<body>
<header class="navbar">
    <a href="{:url('index/index')}" class="navbar-item">
        <img src="__MODULE_LIBS__/img/back.png"/>&nbsp;{$is_language?'返回':'Return'}
    </a>

    <div class="navbar-center">{$is_language?'經紀商設置':'Broker settings'}</div>
    <div class="navbar-item1">
        <select name="" id="yy">
            <option value="1" {$is_language?
            'selected':''}>中文</option>
            <option value="0" {$is_language?
            '':'selected'}>English</option>
        </select>
    </div>
</header>

<div class="content">
    <form action="" method="post">
        <div class="weui-cells weui-cells_form concenter">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">{$is_language?'區域經紀商':'Regional brokers'}</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" name="brokers1" id="brokers1" value="{$user['brokers1']}" onkeyup="value=value.replace(/[^\d.]/g,'')">
                </div>
                <div class="weui-cell__ft"><p class="weui-vcode-btn1"><span class="brokers1">{$user['brokers1']*100}</span>%</p></div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">{$is_language?'大區經紀商':'Large district brokers'}</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" name="brokers2" id="brokers2" value="{$user['brokers2']}" onkeyup="value=value.replace(/[^\d.]/g,'')">
                </div>
                <div class="weui-cell__ft"><p class="weui-vcode-btn1"><span class="brokers2">{$user['brokers2']*100}</span>%</p></div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">{$is_language?'國際經紀商':'International brokers'}</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" name="brokers3" id="brokers3" value="{$user['brokers3']}" onkeyup="value=value.replace(/[^\d.]/g,'')">
                </div>
                <div class="weui-cell__ft"><p class="weui-vcode-btn1"><span class="brokers3">{$user['brokers3']*100}</span>%</p></div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">{$is_language?'同等級經紀商':'The same level broker'}</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" name="brokers" id="brokers" value="{$user['brokers']}" onkeyup="value=value.replace(/[^\d.]/g,'')">
                </div>
                <div class="weui-cell__ft"><p class="weui-vcode-btn1"><span class="brokers">{$user['brokers']*100}</span>%</p></div>
            </div>
        </div>

        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">{$is_language?'密碼':'password'}</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="password" name="password"
                           placeholder="{$is_language?'請輸入您的密碼':'Please input your password'}">
                </div>
            </div>
        </div>
        <div class="weui-btn-area">
            <input class="weui-btn weui-btn_warn" type="submit" value="{$is_language?'確&nbsp;認':'Determine'}">
        </div>
    </form>
</div>


<script type="text/javascript">
    $('#brokers1').bind('input propertychange', function() {
        var brokers1 = $(this).val()*100;
        var brokers1 = brokers1.toFixed(1);
        $('.brokers1').html(brokers1);
    });
    $('#brokers2').bind('input propertychange', function() {
        var brokers2 = $(this).val()*100;
        var brokers2 = brokers2.toFixed(1);
        $('.brokers2').html(brokers2);
    });
    $('#brokers3').bind('input propertychange', function() {
        var brokers3 = $(this).val()*100;
        var brokers3 = brokers3.toFixed(1);
        $('.brokers3').html(brokers3);
    });
    $('#brokers').bind('input propertychange', function() {
        var brokers = $(this).val()*100;
        var brokers = brokers.toFixed(1);
        $('.brokers').html(brokers);
    });


    $(document).on("change", 'select#yy', function () {
        var yy = $(this).val();
        console.log(yy)
        var url = "{:url('index/language')}";
        $.post(url, {language: yy}, function (res) {
            window.location.reload();
        })
    });
</script>
</body>
</html>
